# 第一种方法
formatStr = 'My name is {}, a {} years old {}.'
person1 = formatStr.format('Alex','16', 'boy')

print(person1)
# My name is Alex, a 16 years old boy.

# 第二种方法
formatStr2 = 'My name is {name}, a {age} years old {ginder}.'
person2 = formatStr2.format(name="Alex", age="18", ginder="boy")
print(person2)
# My name is Alex, a 18 years old boy.